package ace.module.account.core.impl.controller.rest.rpc.ext;

import ace.cmp.core.model.R;
import ace.cmp.security.oauth2.resource.server.core.annotation.PreAuthorizeIsInternalClient;
import ace.module.account.core.impl.service.IamOauth2Service;
import ace.module.account.sdk.core.feign.impl.IamOauth2Feign;
import ace.module.common.api.annotation.ApiRemoteImplementPriority;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * .
 *
 * @author Caspar
 */
@Tag(name = "账户oauth2-RPC-API")
@AllArgsConstructor
@PreAuthorizeIsInternalClient
@RestController
@RequestMapping(IamOauth2Feign.PATH)
@ApiRemoteImplementPriority
public class IamOauth2RpcController implements IamOauth2Feign {

  private final IamOauth2Service iamOauth2Service;

  @Override
  public R<String> getAdminAdministratorAccessTokenValue() {
    String result = iamOauth2Service.getDefaultAdminAdministratorAccessTokenValue();
    return R.ok(result);
  }
}
